All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.app.actions.Dragger
java.lang.Object
|
+----quicktime.app.actions.MouseResponder
|
+----quicktime.app.actions.Dragger
- public class Dragger
- extends MouseResponder
The Dragger is a particular type of MouseResponder that performs the action
of moving the Dragger's target (a Transformable object) according to the
drag movements of the mouse.
Dragger's can be constrained to keep their target object completely within
their enclosing space, or allow the target to be dragged out of that space
to a default minimum view of 1 row or column of pixels of the target.
When a constraining condition is reached the Dragger will invoke the
trigger method of an attached Actionable object.
-
actor
- The actor that will be invoked (if set) when the dragger
reaches a constraining condition
-
kConstrainAll
- Use these as constraint flags to restrict dragging operations
-
kConstrainBottom
- Use these as constraint flags to restrict dragging operations
-
kConstrainHorizontal
- Use these as constraint flags to restrict dragging operations
-
kConstrainLeft
- Use these as constraint flags to restrict dragging operations
-
kConstrainNone
- Use these as constraint flags to restrict dragging operations
-
kConstrainRight
- Use these as constraint flags to restrict dragging operations
-
kConstrainTop
- Use these as constraint flags to restrict dragging operations
-
kConstrainVertical
- Use these as constraint flags to restrict dragging operations
-
space
- This is the QTDrawable space within which the Dragger's target is enclosed and contained
-
target
- This is the Transformable target of the Dragger action
-
xBufferIfUnConstrained
- The number of pixels on the horizontal axis that an object can be dragged beyond the bounds
if the dragging action is unconstrained.
-
yBufferIfUnConstrained
- The number of pixels on the vertical axis that an object can be dragged beyond the bounds
if the dragging action is unconstrained.
-
Dragger(int)
- Create a Dragger object
-
Dragger(int, int)
- Create a Dragger object with specified modifier keys and test conditions under
which those modifier keys are matched.
-
Dragger(int, int, int)
- Set some parameters that will create DragActions.
-
getActionable()
- This method retreives the current actor that is attached to the action
-
getConstrained()
- Returns the current constraint setting
-
isAppropriate(Object)
- The Dragger knows how to drag objects of type Transformable around.
-
mouseDragged(MouseEvent)
- This method will allow the user to drag the transformable object around.
-
mousePressed(MouseEvent)
- This method is called by the MouseController when the mouse is first pressed down on
a valid Transformable object within the space it is controlling.
-
removeTarget()
- When the MouseController detects that the drag operation is completed it notifies
the Dragger to remove its target as the user no longer is dragging.
-
setActionable(Actionable)
-
This method sets the actionable object of the action.
-
setConstrained(int)
- Using the constrain constants dragging can be constrained in any direction.
-
setTarget(Object)
- Sets the target of the Dragger.
-
setTargetSpace(Object)
- This method sets the containing Space of a target of a MouseResponder.
kConstrainNone
public static final int kConstrainNone
- Use these as constraint flags to restrict dragging operations
kConstrainLeft
public static final int kConstrainLeft
- Use these as constraint flags to restrict dragging operations
kConstrainRight
public static final int kConstrainRight
- Use these as constraint flags to restrict dragging operations
kConstrainTop
public static final int kConstrainTop
- Use these as constraint flags to restrict dragging operations
kConstrainBottom
public static final int kConstrainBottom
- Use these as constraint flags to restrict dragging operations
kConstrainHorizontal
public static final int kConstrainHorizontal
- Use these as constraint flags to restrict dragging operations
kConstrainVertical
public static final int kConstrainVertical
- Use these as constraint flags to restrict dragging operations
kConstrainAll
public static final int kConstrainAll
- Use these as constraint flags to restrict dragging operations
actor
protected Actionable actor
- The actor that will be invoked (if set) when the dragger
reaches a constraining condition
target
protected Transformable target
- This is the Transformable target of the Dragger action
space
protected QTDrawable space
- This is the QTDrawable space within which the Dragger's target is enclosed and contained
xBufferIfUnConstrained
protected int xBufferIfUnConstrained
- The number of pixels on the horizontal axis that an object can be dragged beyond the bounds
if the dragging action is unconstrained. The default is one
yBufferIfUnConstrained
protected int yBufferIfUnConstrained
- The number of pixels on the vertical axis that an object can be dragged beyond the bounds
if the dragging action is unconstrained. The default is one
Dragger
public Dragger(int modifierKeyMask)
- Create a Dragger object
- Parameters:
- modifierKeyMask - - if specified will determine which modifier keys must
be depressed for the action to be invoked. The modifierTestConditions is set
in this case to MouseResonder.kModifiersExactMatch
Dragger
public Dragger(int modifierKeyMask,
int modifierTestConditions)
- Create a Dragger object with specified modifier keys and test conditions under
which those modifier keys are matched.
- Parameters:
- modifierKeyMask - - if specified will determine which modifier keys must
be depressed for the action to be invoked.
- modifierTestConditions - the test conditions under which the modifier mask is tested
Dragger
public Dragger(int modifierKeyMask,
int modifierTestConditions,
int additionalEvents)
- Set some parameters that will create DragActions.
- Parameters:
- modifierKeyMask - - if specified will determine which modifier keys must
be depressed for the action to be invoked.
- modifierTestConditions - the test conditions under which the modifier mask is tested
- additionalEvents - additional mouse events the responder will respond to
setTargetSpace
protected void setTargetSpace(Object o)
- This method sets the containing Space of a target of a MouseResponder.
For a Dragger this space must be a QTDrawable.
- Parameters:
- o - the containing space of the potential targets of the Dragger.
- Overrides:
- setTargetSpace in class MouseResponder
setActionable
public void setActionable(Actionable actor)
- This method sets the actionable object of the action.
getActionable
public Actionable getActionable()
- This method retreives the current actor that is attached to the action
isAppropriate
public boolean isAppropriate(Object object)
- The Dragger knows how to drag objects of type Transformable around.
Thus this method returns true if the incoming object implements the Transformable interface.
- Parameters:
- object - the object to test
- Returns:
- a boolean
- Overrides:
- isAppropriate in class MouseResponder
setTarget
protected void setTarget(Object t)
- Sets the target of the Dragger. Generally this will be some kind of Transformable object
that the user has clicked on and the MouseController has extracted. This becomes
the active Target of the Dragger for the duration of the mouseDrag event.
- Parameters:
- t - the Transformable target
- Overrides:
- setTarget in class MouseResponder
removeTarget
protected void removeTarget()
- When the MouseController detects that the drag operation is completed it notifies
the Dragger to remove its target as the user no longer is dragging.
- Overrides:
- removeTarget in class MouseResponder
setConstrained
public void setConstrained(int flag)
- Using the constrain constants dragging can be constrained in any direction.
- Parameters:
- flag - constraint flag
getConstrained
public int getConstrained()
- Returns the current constraint setting
mousePressed
public void mousePressed(MouseEvent event)
- This method is called by the MouseController when the mouse is first pressed down on
a valid Transformable object within the space it is controlling.
For efficiency it is assumed that the overall characteristics of the enclosing space
will not be changing during the duration of the drag event - ie. the Matrix
of the enclosing space is not changing during a mouse drag. However the Target's
matrix can and will change as a result of the drag operation.
- Parameters:
- event - the mouse down event that may begin the drag action
- Overrides:
- mousePressed in class MouseResponder
mouseDragged
public void mouseDragged(MouseEvent event)
- This method will allow the user to drag the transformable object around.
This method also does constraints testing based on the current state
of the constraints.
- Parameters:
- event - the mouse drag event that triggered the drag action.
- Overrides:
- mouseDragged in class MouseResponder
All Packages Class Hierarchy This Package Previous Next Index